package com.lancoo.znbkxx.teacher.adapter

import android.os.Handler
import android.widget.CompoundButton
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.lancoo.znbkxx.teacher.R
import com.lancoo.znbkxx.teacher.model.data.ValidStu
import com.lancoo.znbkxx.teacher.utils.DensityUtils
import com.luck.picture.lib.tools.ScreenUtils
import kotlinx.android.synthetic.main.item_switch_student.view.*


/**
 * Created by wealive on 2021/3/11.
 *
 *
 */
class SwitchStudentAdapter(data: List<ValidStu>) :
        BaseQuickAdapter<ValidStu, BaseViewHolder>(data) {
    init {
        mLayoutResId = R.layout.item_switch_student
    }

    override fun convert(helper: BaseViewHolder, item: ValidStu?) {
        with(helper.itemView) {
            tv.text = item?.StuName
            tv.width = (ScreenUtils.getScreenWidth(context) - DensityUtils.dp2px(context, 55f)) / 4
            tv.isChecked = item!!.Checked
        }
    }
}